package com.spcloud.fegin.client.controller;

import com.spcloud.common.entity.Order;
import com.spcloud.fegin.client.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author GuoChunbo
 * @create 2020-03-12 8:58
 * @Description: 类的描述
 */
@RestController
public class OrderController {
    
    @Autowired
    OrderService orderService;
    
    /**
     * getorderlist
     */
    @GetMapping("/order/list") //不需要和服务端请求保持一致
    public List<Order> getorderlist(){

        //调用服务，和调用接口的方法一样
        try{
            return orderService.orderList();
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}
